import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';


// 新增自定义路由

import { HomepageComponent }  from './homepage/homepage.component';
import { HeroesComponent }      from './heroes/heroes.component';
import { DashboardComponent }   from './dashboard/dashboard.component';
import { HeroDetailComponent }  from './hero-detail/hero-detail.component';
import { TestPrimeComponent }  from './test-prime/test-prime.component';


const routes: Routes = [
  { path: '', redirectTo: '/test-prime', pathMatch: 'full' },// 默认路由
  { path: 'homepage', component: HomepageComponent },  // 首页
  { path: 'heroes', component: HeroesComponent },
  { path: 'dashboard', component: DashboardComponent },
  { path: 'detail/:id', component: HeroDetailComponent },
  { path: 'test-prime', component: TestPrimeComponent },  
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [ RouterModule ],
  declarations: []
})
export class AppRoutingModule { }